class Account {
    get bankCharge() {
        let result = 4.5;
        if (this._daysOverdrawn > 0) {
            result = + this.overdraftCharge;
        }
        return result;
    }

    get overdraftCharge() {
        if (this.type.isPremiun) {
            const baseCharge = 10;
            if (this.daysOverdrawn <= 7) {
                return baseCharge;
            } else {
                return baseCharge + (this.daysOverdrawn - 7) * 0.85;
            }
        } else {
            return this.daysOverdrawn * 1.75;
        }
    }
}
/***************************************** */
class Account {
    get bankCharge() {
        let result = 4.5;
        if (this._daysOverdrawn > 0) {
            result = + this.overdraftCharge;
        }
        return result;
    }

    get overdraftCharge(){
        return this.type.overdraftCharge(this.daysOverdrawn);
    }
}

class AccountType{
    overdraftCharge(daysOverdrawn) {
        if (this.isPremiun) {
            const baseCharge = 10;
            if (daysOverdrawn <= 7) {
                return baseCharge;
            } else {
                return baseCharge + (daysOverdrawn - 7) * 0.85;
            }
        } else {
            return daysOverdrawn * 1.75;
        }
    }
}